#ifndef ArExpes_H
	#define ArExpres_H
	#include "functions.h"
	#include <string>
	#include <map>
	#include <sstream>
	#include <vector>
	using namespace std;
	class AriphmeticExpression
	{
	private:
		Function * head;
		
		static size_t const MAXN = 100500;
		size_t size_;
		int    isMarking[MAXN];
		bool   isValue[MAXN];
		bool   isOperator[MAXN];
		bool   isVar[MAXN];
		double values[MAXN];
		string expression[MAXN];
		map <string, int> priority;

		Function * BuildTree(size_t & nowPos, int nowPrior);
		void SetPriority();
		void BuildExpression(string expres);

	public:
		AriphmeticExpression(string expres);
		~AriphmeticExpression();
		double F(double x);
		void SetExpression(string expres);
	};
#endif